<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
	
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page language="java" import="java.sql.*" %>
<%	String driver = "org.h2.Driver";
	Class.forName(driver).newInstance();
	Connection con=null;
	ResultSet rst=null;
	Statement stmt=null;
	try{
		con=DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
		stmt=con.createStatement();
	}
	catch(Exception e){
		System.out.println(e.getMessage());
	}
	rst=stmt.executeQuery("select * from dj");
		%>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<jsp:include page="HEAD.txt"></jsp:include>
	<link rel="stylesheet" type="text/css" href="styl.css">
		<title>Dodawanie Audycji</title>
		<script src="gen_validatorv4.js" type="text/javascript"></script>
	</head>
	<body>
	<jsp:include page="A.txt"></jsp:include>
	
		<h3>Dodawanie Audycji</h3>
		<form action="AudycjaAdd" method="post" name="entry" id="entry" onSubmit="return validate(this)">
		<table>
			<tr>
				<td>Nazwa audycji</td>
				<td><input type="text" name="nazwa"></td>
			</tr>
			
			<tr>
				<td>Opis audycji</td>
				<td><textarea rows="5" cols="50" name="opis"></textarea> </td>
			</tr>
			<tr>
				<td>Godzina emisji:</td>
				<td>
					<select name="godzina">
						<option value="0">00:00</option>
						<option value="1">01:00</option>
						<option value="2">02:00</option>
						<option value="3">03:00</option>
						<option value="4">04:00</option>
						<option value="5">05:00</option>
						<option value="6">06:00</option>
						<option value="7">07:00</option>
						<option value="8">08:00</option>
						<option value="9">09:00</option>
						<option value="10">10:00</option>
						<option value="11">11:00</option>
						<option value="12">12:00</option>
						<option value="13">13:00</option>
						<option value="14">14:00</option>
						<option value="15">15:00</option>
						<option value="16">16:00</option>
						<option value="17">17:00</option>
						<option value="18">18:00</option>
						<option value="19">19:00</option>
						<option value="20">20:00</option>
						<option value="21">21:00</option>
						<option value="22">22:00</option>
						<option value="23">23:00</option>
						
						
					</select> 				
				</td>
			</tr>
			<tr>
				<td>Dzień tygodnia</td>
				<td>	
					<label for="poniedzialek">poniedzialek</label>				
					<input type="checkbox" id="poniedzialek" name="poniedzialek" value="y" >
					
					<label for="wtorek">wtorek</label>
					<input type="checkbox" id="wtorek" name="wtorek" value="y" >
					
					<label for="sroda">sroda</label>
					<input type="checkbox" id="sroda" name="sroda" value="y" >
					
					<label for="czwartek">czwartek</label>
					<input type="checkbox" id="czwartek" name="czwartek" value="y" >
					
					<label for="piatek">piatek</label>
					<input type="checkbox" id="piatek" name="piatek" value="y" >
					
					<label for="sobota">sobota</label>
					<input type="checkbox" id="sobota" name="sobota" value="y" >
					
					<label for="niedziela">niedziela</label>
					<input type="checkbox" id="niedziela" name="niedziela" value="y" >
					
				</td>
			</tr>
				
			<tr>
			<td><label for="dj">Prowadzący audycje</label></td>
			<td><select name=dj>
			 	<%while(rst.next()){%>
<option value="<%=rst.getString("id")%>"><%=rst.getString("imie") %> <%=rst.getString("nazwisko") %></option>	  
				<%	}%>				
</select></td>
			</tr>
				
				
			<tr>
				<td>
					<input type="submit" value="Dodaj">&nbsp;
					<input type="reset" value="Wyczyść">
				</td>
				</tr>
		</table>
	</form>
	<script type="text/javascript">
var frmvalidator  = new Validator("entry");
frmvalidator.addValidation("nazwa","req","Wprowadz poprawna nazwe");
frmvalidator.addValidation("opis","req","Wprowadz poprawny opis");
</script>
<jsp:include page="Z.txt"></jsp:include>

	</body>
</html>
<%rst.close();stmt.close();
	con.close();%>